if (has_peerkey)
return usage(progname);
- if (!parse_key(peerkey, optarg)) {
+ if (!parse_key(peerkey, optarg))
return 1;
- }
has_peerkey = true;
break;
return 1;
has_key = true;
- edsign_sec_to_pub(pubkey, seckey);
- has_pubkey = true;
break;
case 'k':
if (has_pubkey)
return usage(progname);
- if (!parse_key(pubkey, optarg)) {
+ if (!parse_key(pubkey, optarg))
return 1;
- }
has_pubkey = true;
break;
if (has_pubkey)
return usage(progname);
- if (!parse_key(seckey, optarg)) {
+ if (!parse_key(seckey, optarg))
return 1;
- }
has_key = true;
-
- edsign_sec_to_pub(pubkey, seckey);
- has_pubkey = true;
break;
case 'p':
password_prompt++;
}
}
+ if (has_key) {
+ edsign_sec_to_pub(pubkey, seckey);
+ has_pubkey = true;
+ }
+
if (!has_peerkey && cmd_needs_peerkey()) {
INFO("Missing -h <key> argument\n");
return 1;